//build：20240314
//The basic rectangle object, similar to a div, can load any other control.
import utils from "./uiUtils.js"
import base from "./uiBase.js"
let view = {}
/**
 * Create a view and load it on the parent control object.
 * @param {string} id Control ID (required)
 * @param {object} parent Parent object
 * @returns The view object after creation
 */
view.build = function (id, parent) {
    let temp = utils.validateBuild(view.all, id, parent, 'view')
    let my = {type: 'view'}
    if (temp === 0 || temp === 1 || temp === 2) {
        my.obj = new utils.GG.NativeBasicComponent({ uid: id }, null, temp)
    }
    else {
        my.obj = new utils.GG.NativeBasicComponent({ uid: id }, temp)
    }
    my.id = id
    let comp = Object.assign(my, base);
    utils.setParent(this.all,comp,parent)
    return comp;
}

export default view;